from dailyfresh.celery import app
import time


@app.task
def task1():
    """无参方法"""
    print("task1...begin...")
    time.sleep(10)  # 模拟耗时操作
    print("task1...end...")


@app.task
def task2(a, b):
    """有参方法"""
    print("task2...begin...a={},b={}".format(a, b))
    time.sleep(10)  # 模拟耗时操作
    print("task2...end...")
    return a + b
@app.task
def task_send_message(to, datas, tempId=1):
    """
    发送模板短信
    :param to: 手机号
    :param datas: ["验证码内容",有效期分钟]
    :param tempId: 模板id
    :return:
    """
    from dailyfresh.rly import  sendTemplateSMS
    sendTemplateSMS(to, datas)